#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include<iostream> 
using namespace std;
typedef struct node{
   int data;
   struct node *next;
}ListNode;
typedef ListNode *List;
void CreateList(List &L,int n);
void ReverseList(List &L);
void PrintList(List L);

int main()
{
       int n;
      List L;
      cin>>n;
     CreateList(L,n);
     ReverseList(L);
    PrintList(L);

 } 
void CreateList(List &L,int n)
{
	int i;
	List r,s;
	L=new node;
	L->next=NULL;
	r=L;
	for(i=1;i<=n;i++){
		s=new node;
		cin>>s->data;
		r->next=s;
		r=s;	
	}
	r->next=NULL;
 } 
void ReverseList(List &L){
	List r,temp;
	r=new node;
	r->next=NULL;

	L=L->next;
	while(L){
		temp=new node;
		temp->data=L->data;
		temp->next=r->next;
		r->next=temp;
		L=L->next;
	}
	L=r;
}
void PrintList(List L)
{
	int flag=0;
	L=L->next;
	if(!L)
	cout<<"NULL";
	while(L){
		if(flag==0){
		cout<<L->data;flag=1;}
		else
		cout<<" "<<L->data;
		L=L->next;
	}
}
